<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title> Informes de paises</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/spacelab.css" %}">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/responsive.css" %}">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/misestilos.css" %}">
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/jquery.js" %}"></script>
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/menu_jquery.css" %}">
    </head>
    <body>

        {% include "topmenu.html" %} <!-- Top menu -->

        <div class="container">
            <div class="row-fluid">

                {% include "sidebar.html" %} <!-- Side bar -->

                <div class="span8">
                    <div class="page-header">
                        <h4> Informes en base a los indicadores</h4>
                        <h3> {{ universidad_en_cuestion.nombre }} </h3>
                        {% if mensaje %}
                        <div class="alert alert-success">
                            {{ mensaje }}
                        </div>
                        {% endif %}
                    </div>
                    <table cellpadding="3px" cellspacing="3px" width="100%" border="1">
                        <tr>
                            <th colspan="2">Periodo</th>
                            {% if is_adm_institucional == True %}
                            <th colspan="3">Opción</th>
                            {% else %}
                            <th>Opción</th>
                            {% endif %}
                            
                        </tr>
                        {% if bandera_control == False %}
                        <tr>
                            <td colspan="4" align="center"> No existen informes anteriores </td>
                        </tr>
                        {% else %}
                        {% for inicio, fin, codigo in datos %}
                        <tr>
                            <td align="center"> {{ inicio }} </td>
                            <td align="center"> {{ fin }} </td>
                            <td align="center"><a class="btn btn-primary" href="/plataforma/indicadores/ver_informe_viejo/{{codigo}}">Ver</a></td>
                            {% if is_adm_institucional == True %}
                            <td align="center"><a class="btn btn-primary" href="/plataforma/indicadores/formulario/0/{{codigo}}">Editar</a></td>
                            <td align="center"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#informe-{{codigo}}">Eliminar</button></td>
                            
                            <!--------------- MODALS -->
                            
                            <div id="informe-{{codigo}}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-header">
                            <h3>Confirmar eliminación de indicador
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                ×
                            </button>
                            </h3>
                        </div>
                        <div id="mensaje-modal" class="modal-body">
                            Seguro que desea eliminar el informe correspondiente al periodo {{inicio }} al {{fin}}?
                        </div>
                        <div class="modal-footer">
                            <button class="btn" data-dismiss="modal" aria-hidden="true">
                                Cancelar
                            </button>
                            <a class="btn btn-primary" href="/plataforma/indicadores/eliminar-informe/{{codigo}}">Confirmar y eliminar</a>
                        </div>
                    </div>    
                            {% endif %}
                            
                        </tr>
                        {% endfor %}
                        {% endif%}

                    </table>
                </div>
            </div>

            {% include "footer.html" %} <!-- Footer -->
        </div>
        <!-- container -->

        <!-- JS files -->
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap-formhelpers-countries.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap-formhelpers-countries-US.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/menu_jquery.js" %}"></script>
    </body>
</html>